package com.mvc.business.user.service.imp;

import java.util.List;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.mvc.business.user.service.UserService;
import com.mvc.dao.UserDao;
import com.mvc.vo.User;

@Service
public class UserServiceImpl implements UserService {
	
	@Resource(name="userDaoImpl")
	private UserDao userDao;
	
	public List<User> list() {
		return userDao.list();
	}

	public User getUser(String id) {
		return userDao.getUser(id);
	}

	public void update(User user) {
		userDao.update(user);
	}

	public void delete(String id) {
		User user = new User();
		user.setId(id);
		userDao.delete(user);
	}

	public void insert(User user) {
		user.setId(UUID.randomUUID().toString());
		userDao.insert(user);
	}
	
}
